#!/bin/sh
dir=$(dirname `readlink -f $0`)
cd $dir
./stop.sh && ./start.sh
sleep 1
if [ -z "`ps -ef  |grep "$dir" |grep -v grep `" ] ; then
    #有些应用停止慢，导致立即启动失败，尝试再启动一次
    sleep 2
    ./start.sh
fi